home *** CD-ROM | disk | FTP | other *** search
- Path: nyssa.swt.edu!kv09845
- From: kv09845@nyssa.swt.edu (They Run, Sheep To The Fold)
- Newsgroups: comp.lang.c
- Subject: ERR with typedef...lvalue
- Date: 15 Feb 96 19:01:09 CST
- Organization: Southwest Texas State University
- Message-ID: <1996Feb15.190109@nyssa.swt.edu>
- NNTP-Posting-Host: nyssa.swt.edu
-
-
- The following is a program I can't seem to get to compile. It keeps giving me
- an error. Would anyone happen to know why. I'm sure it's simple, but then, so
- am I. Any help greatly appreciated.
-
- THE SOURCE CODE:
- ----------------
-
- #include <stdio.h>
-
- main ()
- {
- typedef char STRING[81];
-
- STRING text, input_line;
-
- text = "this is the text string";
- input_line = "this is the input_line string";
-
- printf("%s\n", text);
- printf("%s\n", input_line);
-
- }
-
- THE .LIS FILE FROM THE COMPILER (DEC C):
- ----------------------------------------
-
- Source Listing 15-FEB-1996 18:56:35 DEC C V5.2-003 Page 1
- 15-FEB-1996 18:56:25 DISK$A4:[KV09845.C]TEST.C;4
-
- 1
- 2 #include <stdio.h>
- 676
- 677 main ()
- 678 {
- 679 typedef char STRING[81];
- 680
- 681 STRING text, input_line;
- 682
- 683 text = "this is the text string";
- ....1
- %CC-E-NEEDLVALUE, (1) In this statement, "text" is not an lvalue, but occurs
- in a context that requires one.
-
- 684 input_line = "this is the input_line string";
- ....1
- %CC-E-NEEDLVALUE, (1) In this statement, "input_line" is not an lvalue, but
- occurs in a context that requires one.
-
- 685
- 686 printf("%s\n", text);
- 687 printf("%s\n", input_line);
- 688
- 689 }
- 690
- 691
-
-
-